test: add Maestro provider integration guards#620
Conversation
thymikee
left a comment
There was a problem hiding this comment.
Review — provider-backed Maestro guards
Good additions. Provider-backed replay guards are exactly the safety net needed to refactor the Maestro layer toward "behave like Maestro, but faster" with confidence, and the optional-tap-miss case (optional: true must not touch the device) is a particularly valuable compat invariant to lock down.
A few things to coordinate before/at merge:
-
Duplicate tests across the stack. Two of these tests are byte-for-byte duplicated in sibling PRs:
- "coalesces tapOn inputText and pressKey Enter through native paths" is also added in #623.
- "executes runFlow conditions and retry batches at runtime" is also added in #626.
Whichever lands second will hit a merge conflict (or, worse, silently produce two identically-named
test(...)blocks). Please pick a single home for each — either this umbrella PR owns the guards and #623/#626 drop them, or vice versa. -
The Enter case doesn't actually guard the #623 convergence. This flow uses
tapOn+inputText+pressKey: Enter, which already coalesces towait+fillonmainvia the existing Enter path. The new behavior in #623 is coalescing without a trailing Enter. If the intent is to guard the convergence work, add the no-Enter variant here so a regression inoptimizeTypedAfterTapis caught. -
Loose
snapshots >= 2/3assertions are fine as smoke checks, but consider asserting exact counts where the flow is deterministic — it would catch accidental extra round-trips, which matters for the "faster" goal.
Nothing blocking on the test logic itself.
Generated by Claude Code
thymikee
left a comment
There was a problem hiding this comment.
Addressed in ba3308e:
- Kept the umbrella provider guards in #620; #623/#626 can drop their duplicate copies later.
- Added a provider-backed
tapOn+inputTextno-Enter guard, and kept a separate Enter-preservation guard with a distinct test name. - Updated
optimizeTypedAfterTapso input-lookingtapOn+inputTextcoalesces towait+fillwithout requiring trailing Enter. - Replaced deterministic provider snapshot
>=checks with exact counts.
Validation passed: focused provider integration test, focused Maestro replay-flow unit test, pnpm typecheck, and pnpm format with unrelated formatter churn restored.
|
Summary
Add provider-backed Android Maestro replay suite coverage for directory YAML discovery, fresh selector snapshots plus content-lane swipes, the native input submit path, no-Enter focused typing, runtime runFlow/retry batches, and optional tap miss behavior.
Touched-file count: 1. Scope stays within the provider integration test suite.
Validation
Verified with focused provider/unit checks and TypeScript:
pnpm exec vitest run --project provider-integration test/integration/provider-scenarios/android-test-suite.test.tspassed with 7 tests.pnpm exec vitest run --project unit src/compat/maestro/__tests__/replay-flow.test.tspassed with 27 tests.pnpm typecheckpassed.pnpm formatpassed; unrelated formatter churn was restored before commit.